package com.jeeplus.mob.service;

import com.jeeplus.common.json.AjaxJson;
import com.jeeplus.mob.common.StringHelper;
import com.jeeplus.mob.entity.mobpojo.Agreement;
import com.jeeplus.mob.mapper.AgreementMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AgreementService {

    @Autowired
    private AgreementMapper agreementMapper;


    /**
     * 获取协议内容
     * @param agreementType：（协议类型（1：用户协议，2：隐私协议）
     * @return
     */
    public AjaxJson getAgreementInfo(String agreementType) {
        Agreement agreement = agreementMapper.selectByPrimaryType(agreementType);
        if (StringHelper.IsEmptyOrNull(agreement)) {
            return AjaxJson.success("查询无结果！");
        }
        return AjaxJson.success().put("data",agreement);
    }
}
